home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / Hack / MISC / HTC1.ZIP / HOWTO1.TXT
Encoding:
Text File  |  1996-05-18  |  16.9 KB  |  307 lines

  1.  
  2.               HOW TO CRACK, A TUTORIAL - LESSON 1
  3.                  by +ORC (the old red cracker)
  4.  
  5. -> How to crack, an approach                      LESSON 1
  6. How to crack, tools and tricks of the trade       LESSON 2
  7. How to crack, hands on, paper protections         LESSON 3 (1-2)
  8. How to crack, hands on, time limits               LESSON 4
  9. How to crack, hands on, disk-CDrom access         LESSON 5
  10. How to crack, funny tricks                        LESSON 6 (1-2)
  11. How to crack, intuition and luck                  LESSON 7
  12. How to crack windows, an approach                 LESSON 8
  13. How to crack windows, tools of the trade          LESSON 9
  14. How to crack, advanced cracking                   LESSON A (1-2)
  15. How to crack, zen-cracking                        LESSON B
  16. How to crack, cracking as an art                  LESSON C
  17. How to crack                                      INDEX
  18.  
  19. LESSON 1 - HOW TO CRACK, AN APPROACH                          
  20.  
  21.      The best way to learn cracking (i.e. understanding, broadly
  22. individuating, locating exactly and eliminating or suspending or
  23. deferring one or more protection schemes inside a software
  24. application you do not possess the source code of) is to begin
  25. your tampering experiments using OLDER applications which have
  26. OLDER protection schemes. 
  27.      In this way you 'll quickly grasp the base techniques of the
  28. trade. Do not forget that the evolution of the protection schemes
  29. has not been a one way road... strictly speaking it's not even
  30. an evolution: you'll eventually find some very clever new tricks,
  31. but most of the time you 'll unearth only various trite
  32. repetitions of past (and well known) tricks. This is no wonder:
  33. the REAL knowledge of the "commercial" programmers themselves
  34. (the "protectionists") is often very limited indeed: they are
  35. inclined to use the old methods (albeit somehow changed,
  36. sometimes even improved) instead of conceiving new methods. This
  37. typical "commercial" degeneration happens every time people act
  38. for money instead of doing things for the sake of it or for
  39. pleasure. This "commercial" trend is blindly encouraged by the
  40. stupid, money-oriented society we are coerced to live in. 
  41.      So I'll begin the "hands on" part (-> starting from lesson
  42. 3), using as examples, some "old" applications and some "old"
  43. tricks. We'll be able to come later over to the newest protection
  44. schemes in order to understand them, and you 'll learn how to
  45. defeat this kind of junk too. I'll also explain WHERE you can
  46. find a lot of programs to crack for next to no money at all, and
  47. HOW 'grossomodo', you should proceed in your work.
  48.  
  49. The applications you'll use to learn with can be divided into:
  50. 1    - Password crippled applications (the easiest to crack)
  51. 2    - applications crippled on how many times, or how many
  52.      days, you use them (fairly easy to crack)
  53. 3    - applications crippled on which date you use them before
  54.      (easy to crack)
  55. 4    - applications that have some functions present but
  56.      disabled (sometimes easy, sometimes difficoult)
  57. 5    - applications crippled on Disk access (protections schemes
  58.      that are now defined as "obsolete") and apps crippled on
  59.      CD-ROM presence (more or less the same methodes, but -
  60.      somehow- not defined as "obsolete") (vey easy to crack)
  61. 6    - CRYPTOGRAFED ADDS ON (i.e. one of the previous protection
  62.      schemes, but with some scrambled or self modifying code
  63.      (XORring and SHRLing codes) (fairly easy to crack)
  64. 7    - None of the above (sometimes difficoult to crack)
  65.  
  66. WHERE TO GET THE STUFF
  67.      The recent widespread appearance of "Demo"-CDROM on magazine
  68. covers is a treasure for all crackers! Obviously even if they are
  69. cheap, you should never buy such magazines immediately on their
  70. release, coz after a short time you 'll get all the copies that
  71. remain unsold for next to free. The demos on CD-ROMs will permit
  72. you to gather quickly a lot of applications -old and new- that
  73. have somehow been crippled (at times with interesting schemes).
  74. Truly a wonderful world of cracking possibilities! Gee! For next
  75. to no money you can secure on one CDROM the whole of LOTUS
  76. applications (or Microsoft or Wordperfect, or you name them) on
  77. "trial for 30 days" or "try it 20 times" editions. You'll really
  78. enjoy to crack them and to use them subsequently for ever and
  79. ever (and/or graciously donate them on the Web to the poor lamers
  80. that have no money and no brain).
  81.      GAMES are definitely not to be frowned upon! They are
  82. extraordinarily interesting from a cracker prospective coz they
  83. are often "overprotected". With this I mean that they possess
  84. protection schemes of a relatively HIGH level hidden inside files
  85. that are not very large. Now, see, it is much more easy, and
  86. simple to track down and eliminate protection schemes inside a
  87. single 35.000 bytes long executable file than to locate them
  88. inside a collection of many lengthy DLLs and overlaids that could
  89. have swollen as long as 2.000.000 bytes each. The lazy bunch of
  90. "modern" programmers relies systematically for protection schemes
  91. on this "hide the sting in the wide desert" logic. As a matter
  92. of fact they are no longer able to program in assembler: they
  93. bank more and more on overbloated "fatty" monstrosities like
  94. Visual Basic, Delphy or Visual C++. (But do not worry... I'll
  95. nevertheless teach you how to crack -and quickly- those huge apps
  96. too).
  97.      There is another reason for employing games instead of
  98. applications as study material: often EXACTLY THE SAME protection
  99. schemes that you find in a simple (and short) shareware game will
  100. be used -without much improving- a little later in order to
  101. "protect" some huge and extremely expensive graphic application.
  102.      For this reason in my tutorial we'll often crack games
  103. protection schemes, even if we'll later apply what we learn
  104. mainly in order to crack the protection schemes of commercial
  105. applications, or to crack the access protection routines to
  106. remote servers, or BBS, or even ATM (cash dispensers). 
  107.      Here follows an example cracking session, that will show you
  108. -I hope- the dos and donts of our art: let's crack together as
  109. introductory example a time crippled application. We'll learn
  110. later (-> LESSON 4) that all applications that are crippled on
  111. time (i.e. "how many times" you use them or "how long" you use
  112. them) rely on analogous protection schemes (albeit with a huge
  113. palette of small variations): 
  114. 1-   they may have a counter which "clicks" every so often: FIND
  115.      IT AND DISABLE IT!
  116. 2-   they may fetch the time_clock interrupts in your machine:
  117.      INTERCEPT THEM YOURSELF!
  118. 3-   they may compare a random_seed with a variable: NOOP IT!
  119. 4-   they may check randomly the date of your other, unrelated,
  120.      files on the hard disk: find this verification routine and
  121.      INVERT the JUMPS!
  122. I wanted to start with a modern example of this "counter clicks"
  123. protection type, just to give you a feeling for cracking, and I
  124. have chosen a widely published demo: you should be able to find
  125. it pretty easily. In order to show you some of the problems you
  126. may encounter we'll crack this example "wrongly" (you'll learn
  127. how to crack effectively in the "HANDS ON" lessons).
  128.      EXAMPLE: ARCADE POOL, Demonstration version, PC Conversion
  129. by East Point Software Ltd, (c) Team 17 Software Ltd 1994. This
  130. demo has been published by many magazines on their CDRom covers
  131. throughout 1995.
  132.      What follows will be useful even if you do not have our
  133. example; nevertheless you should get a copy of this widespread
  134. demo in order to better grasp some of the points that follow.
  135.      This nice demo of a billiard game is time-crippled. It is
  136. crippled on how long you use it: i.e., you can only play 2
  137. minutes, afterwards a "nag" reminder of where and how you can buy
  138. the real version snaps: protectionist squalor at its best. 
  139.      So, how do you proceed? Where does the beginning begin? 
  140. Here is what you could (but not necessarily should) do:
  141.  
  142.      Get [Soft-ice] and load it in your config.sys. See the TOOLS
  143. OF THE TRADE lesson (-> LESSON 2) about this debugger. Version
  144. 2.6 of [Soft-Ice] has been cracked by MARQUIS DE SOIREE and can
  145. be found on the Web for free.
  146. -    vecs s (save all the vectors before loading the babe)
  147. -    start [pooldemo.exe]
  148. -    vecs c (vector compare, save a printing of all hooked
  149.      vectors)
  150. -    enter and leave Soft-ice a few times to understand what's
  151.      going on and where in [pooldemo.exe] are we roaming around
  152.      (you should always check MORE THAN ONCE your findings when
  153.      you snoop around: nothing moves and confuses pointers in a
  154.      more frenzied way than good old "inactive" DOS).
  155. -    have a good look at the map of memory usage ("map")
  156. -    now "snap_save" the main memory regions where
  157.      [pooldemo.exe] dwells... snapping saves "photographyes" of
  158.      memory areas.
  159. -    do not do anything, let just the seconds go by.
  160. -    "snap_compare" every two or three seconds without moving
  161.      anything at all on the game board (no mouse_clicking,
  162.      NOTHING), so that the only changes are (hopefully) the
  163.      changes caused by the time counters. 
  164. -    snap_compare twice in a second.
  165. -    snap_compare at second 00:59 and at second 1:01.
  166. -    snap_compare just before and just after the time limit and
  167.      the snapping of the nag screen.
  168. -    Now collect carefully your printed "snaps" data: write
  169.      clearly on the various sheets the occurrences of the snaps.
  170. -    now comes the graceful "zen-cracking" moment: Sit down with
  171.      a dry Martini and Wodka (obviously only russian Wodka will
  172.      do) and contemplate the printing of the various mutant
  173.      locations. Feel, perceive, empathize! Look closely at the
  174.      locations that have changed in the snap compares. Analyse,
  175.      interpretate, evaluate.
  176. -    Mmm! Hey! Something fishy is changing there, and there, and
  177.      there! (you are lucky, few do actually change in this case:
  178.      only two dozen)
  179. -    breakpoint on execute at the location that you believe act
  180.      as a "continuous" counter, i.e. the location that triggers
  181.      the "a second went by" event when it zeroes.
  182. -    Now set the occurrence counter of BPX in order to break at
  183.      the moment where the location "refills" and restarts from
  184.      the beginning (the equivalent of "one second" went by,
  185.      let's start anew). Use the occurrence counter in order not
  186.      to single-step through the program your life long!
  187. -    IN THIS CASE you 'll quickly locate the refill at location
  188.      3DD0. Here follows the "refill" line:
  189.      xxxx:3DCC C706F1013C00   MOV  WORD PTR [01F1], 003C
  190. The "3C" byte at xxxx:3DD0 represents a counter_byte... i.e. the
  191. program "charges" 3C in this location and then DECs it step by
  192. step to 3B, 3A, 39, 38 etc... till 0. When it reaches 0: bingo!
  193. Sucker user has lost one second more of his precious two minutes.
  194.      Now, you would get a first wizard level if you searched
  195. further on for the exact point where you get the "nag screen" in
  196. order to eliminate the whole witless protection, but you may
  197. think you got it already and you remember anyway that the first
  198. principle in cracking is the following: "once you can eliminate
  199. the effects of a protection, do not look further!"
  200.      Most of the time this is true: you do not always need to
  201. eliminate a "whole" protection scheme (unless you are just
  202. studying it for the joy of it). It's normally easier (and
  203. quicker) to eliminate the "effects" of a given protection scheme.
  204. Unfortunately this is not true in this case.
  205.      Here you believe that you have already found the way: you
  206. got the counter that charges the reverse clock that triggers the
  207. particular protection scheme of [pooldemo.exe]. Now you may think
  208. that if you could modify the refill_value... say changing "3C"
  209. to "EE" (Yeah, the maximum would be FF... but it's always good
  210. practice to avoid such extreme values when cracking) you should
  211. get four times more playtime for your game... more than enough
  212. in order to make the protection scheme useless.
  213.      So you change location xxxx:3DD0 from "3C" to "EE". To work
  214. on bytes you should use a good Hexeditor like PSEDIT (Parity
  215. solutions, [Psedit.exe], brilliant shareware: see the "tool of
  216. the trade" section) but you could also work with simpler
  217. debuggers like [debug] or [symdeb] (-> see lesson 2). If you do,
  218. remember to work on a "dead" copy of your crippled [*.exe] file,
  219. i.e.:
  220.      ren POOLDEMO.EXE POOLDEMO.DED
  221.      symdeb POOLDEMO.DED
  222.      -s (cs+0000):0 Lffff C7 06 F1 01 C3 <-  this string
  223.                                              corresponds to the
  224.                                              refill line).
  225.      cs:3E85   <- symdeb gives you two locations as answer
  226.      cs:3EEA
  227.      -e cs:3E85+4 EE     <- refill changed from C3 to EE
  228.      -w
  229.      ren POOLDEMO.DED POOLDEMO.EXE
  230. Now you run your tampered pooldemo. You think you cracked it, you
  231. glee with satisfaction... but loo! Nothing at all has changed,
  232. everything's as lame as before, you still have only 2 minutes
  233. playtime. How disappointing: how comez it did'nt work?
  234.      Well, for a start you have not been attentive enough! The
  235. search in debug gave you TWO locations, you moron, and not just
  236. the one you just tampered with. Check and you 'll see that the
  237. second location (cs:3EEA) is a MIRROR/CONTROL location (more on
  238. this later). Some times there exist "double" locations... coz at
  239. times it's quicker to use a double routine than to use a
  240. branching if or switch structure... some times the second
  241. locations do mirror the first ones and correct them on the fly
  242. if need be. 
  243.      So you need to modify this too... you act as said above but
  244. this time you enter in debug a
  245.      -e cs:3EEA+4 EE 
  246. before writing back the dead file and then renaming it to exe and
  247. then running it... and loo! Hoow sloow! THERE YOU ARE! Your
  248. crippled POOLDEMO.EXE is now (sort of) unprotected: You think
  249. that you can now play the stupid game up to 12 minutes real time,
  250. even if the protection scheme (and the counter) "believes" that
  251. it is playing only two minutes.
  252.      So you begin to play, and the seconds look veeery sloow, and
  253. everything seems OK, but -alas- NO! At screen second 28 you get
  254. the irritating "two minutes are over" nag screen! Obviously you
  255. were dead wrong: the program "knows" the time directly from the
  256. timer... you only modified the stupid counter ON THE SCREEN.
  257.      So it's back to cracking, and now you are angry, and forget
  258. the quiet ways of the zen-analyse and begin the heavy cracking
  259. you should reserve -if ever- for really complicated schemes. You
  260. now start to check the hooked vectors (you did your routinely
  261. VECS_save before loading pooldemo in [Soft-ice] and your
  262. VECS_compare afterwards) and you see some findings that you
  263. believe interesting:
  264.           vecs c
  265.           08   1EFD:84C6 0CD1:17AC <- the clock
  266.           09   1EFD:85EC 136A:069C <- the keyboard
  267.           22   0BCE:02B1 0BCE:017E <- the terminate
  268.      That's more like it -you think. Smack at the beginning: the
  269. first hooked vector does it! It's good old interrupt_08: the
  270. timer_clicker!
  271.      Some basics for those of you that do not know anything:
  272. INT_08 controls indirectly the INT_1C timer interrupt. The 8253
  273. clock chip generates an IRQ_0 hardware interrupt at a rate of
  274. 18.2 interrupts per second. This gives control to the ISR
  275. (Interrupt Service Routine) that the INT_08 points to... and this
  276. should be at 0CD1:17AC, but has been hooked here, by pooldemo,
  277. to 1EFD:84C6.
  278.      One of the actions taken by the INT_08 ISR within the BIOS
  279. is to issue a software interrupt call to INT_1C, just in case any
  280. software modules within the system have established an intercept.
  281. If no intercepts have been established, the default contents of
  282. the INT_1C vector point to an iret instruction within the BIOS,
  283. so that a null action results. (Iret retrieves the three words
  284. of stack information which were automatically saved when the
  285. interrupt call began, and uses them to restore execution control
  286. to the appropriate point). 
  287.      Normally a protectionist would intercept INT_1C, coz at
  288. every ISR from INT_08 the CPU would fetch the contents of the
  289. corrisponding interrupt vector and make an interrupt style call
  290. to the code at that address (which should contain the iret at
  291. address F000:9876 but can contain any trick they could think of).
  292.      So -you think- the protectionist hooked here INT_08 directly
  293. (a pretty infrequently used protection scheme by the way): What
  294. now?
  295.      A rather drastic misure would be, in such circumstances, to
  296. disable the IRQ_0 level timer interrupt, which is controlled by
  297. bit 0 of the mask register, at address I/O 0021h. The controllers
  298. have IMRs (Interrupt Mask Registers) which can be used to hide
  299. or mask specific interrupts. The IMR of the first controller is
  300. located at port address 21h, while the IMR of the second
  301. controller is located at port 0a1h. When bit 0 within the mask
  302. register is set to 1, no further interrupts will be recognized
  303. for this IRQ level. This unfortunately won't work here, but it's
  304. an interesting technique per se, so you better learn it anyway,
  305. just in case you should need it elsewhere:
  306.  
  307.